package com.zzgele.qmzb.api.utils;

/**
 * Created by Martin on 2017-08-30.
 */
public class EmojiUtil {
    public static String filter(String str){
        if(str == null || str.length() == 0){
            return "";
        }
        StringBuffer sb = new StringBuffer();
        for(int i=0;i<str.length();i++){
            int ch = str.charAt(i);
            int min = Integer.parseInt("E001", 16);
            int max = Integer.parseInt("E537", 16);
            if(ch >= min && ch <= max){
                sb.append("");
            }else{
                sb.append((char)ch);
            }
        }
        return sb.toString();
    }

    /**
     * 测试代码，里面的内容复制粘贴到微信然后发送就可以看到
     * @param args
     */
    public static void main(String[] args) {
        System.out.println(filter("啊阿萨德发秦莞尔"));
    }
}
